/**
 * Ant Design 移动端主题配置
 *
 * 基于设计Token系统，确保移动端视觉一致性
 */

import type { ThemeConfig } from 'antd';
import { designTokens } from '../styles/design-tokens';

/**
 * 移动端Ant Design主题配置
 */
export const antdMobileTheme: ThemeConfig = {
  token: {
    // 颜色配置
    colorPrimary: designTokens.colors.brand.primary,
    colorSuccess: designTokens.colors.functional.success,
    colorWarning: designTokens.colors.functional.warning,
    colorError: designTokens.colors.functional.error,
    colorInfo: designTokens.colors.functional.info,

    colorTextBase: designTokens.colors.text.primary,
    colorBgBase: designTokens.colors.background.primary,
    colorBorder: designTokens.colors.border.default,

    // 字体配置
    fontSize: 16, // 移动端基础字体（更大，易读）
    fontSizeHeading1: 24,
    fontSizeHeading2: 20,
    fontSizeHeading3: 18,
    fontSizeHeading4: 16,
    fontSizeHeading5: 14,

    // 行高配置
    lineHeight: 1.5,
    lineHeightHeading1: 1.5,
    lineHeightHeading2: 1.5,
    lineHeightHeading3: 1.5,

    // 间距配置
    padding: 16,
    paddingSM: 12,
    paddingLG: 24,
    paddingXS: 8,

    margin: 16,
    marginSM: 12,
    marginLG: 24,
    marginXS: 8,

    // 圆角配置
    borderRadius: designTokens.borderRadius.md,
    borderRadiusLG: designTokens.borderRadius.lg,
    borderRadiusSM: designTokens.borderRadius.sm,

    // 控制高度（触摸友好）
    controlHeight: designTokens.touchTarget.minSize, // 44px
    controlHeightLG: 52,
    controlHeightSM: 36,

    // Z-index配置
    zIndexPopupBase: designTokens.zIndex.dropdown,
    zIndexBase: designTokens.zIndex.base,
  },

  components: {
    // Button组件移动端优化
    Button: {
      controlHeight: designTokens.touchTarget.minSize,
      controlHeightLG: 52,
      controlHeightSM: 36,
      paddingContentHorizontal: 16,
      fontSize: 16,
      borderRadius: designTokens.borderRadius.md,
    },

    // Input组件移动端优化
    Input: {
      controlHeight: designTokens.touchTarget.minSize,
      fontSize: 16,
      paddingBlock: 12,
      paddingInline: 12,
      borderRadius: designTokens.borderRadius.md,
    },

    // Select组件移动端优化
    Select: {
      controlHeight: designTokens.touchTarget.minSize,
      fontSize: 16,
      borderRadius: designTokens.borderRadius.md,
    },

    // Modal组件移动端优化
    Modal: {
      padding: 24,
      paddingLG: 24,
      borderRadiusLG: designTokens.borderRadius.lg,
    },

    // Card组件移动端优化
    Card: {
      paddingLG: 16,
      borderRadiusLG: designTokens.borderRadius.lg,
    },

    // Drawer组件移动端优化
    Drawer: {
      padding: 16,
      paddingLG: 16,
    },

    // Table组件移动端优化
    Table: {
      padding: 12,
      paddingSM: 8,
      fontSize: 14, // 表格字体稍小
    },

    // Menu组件移动端优化
    Menu: {
      itemHeight: designTokens.touchTarget.minSize,
      itemBorderRadius: designTokens.borderRadius.sm,
    },

    // Tabs组件移动端优化
    Tabs: {
      titleFontSize: 16,
      cardPadding: '12px 16px',
    },
  },
};

/**
 * 桌面端Ant Design主题配置（保持原有体验）
 */
export const antdDesktopTheme: ThemeConfig = {
  token: {
    colorPrimary: designTokens.colors.brand.primary,
    colorSuccess: designTokens.colors.functional.success,
    colorWarning: designTokens.colors.functional.warning,
    colorError: designTokens.colors.functional.error,
    colorInfo: designTokens.colors.functional.info,

    colorTextBase: designTokens.colors.text.primary,
    colorBgBase: designTokens.colors.background.primary,
    colorBorder: designTokens.colors.border.default,

    fontSize: 14,
    borderRadius: designTokens.borderRadius.sm,

    // 桌面端默认尺寸
    controlHeight: 32,
    controlHeightLG: 40,
    controlHeightSM: 24,
  },
};
